package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author XCQ
 */
@Service("userService4")
public class UserServiceImpl4 implements UserService {
    @Value("${jdbc.userName}")
    private String userName;

    @Value("${jdbc.password}")
    private String password;

    @Resource(name = "userDao")
    private UserDao dao;

    @Autowired
    private User user;

    public UserServiceImpl4() {
        System.out.println("userService init ...");
    }


    @Override
    public void add() {
        System.out.println("run..." + userName + "====" + password);
        System.out.println(user);
        dao.add();
    }

    @Override
    public String getName(String data) {
        return data;
    }
}
